package com.atguigu.distributed.lock.leecode;

public class LinkedDoubleReSort {
    public ListNode oddevenList(ListNode head){
        if(head==null){
            return head;
        }
        ListNode even = head.next;
        ListNode odd = head;
        ListNode evenhead = even;
        while (even!=null&&evenhead!=null){
            odd.next = even.next;
            odd = odd.next;
            even.next = odd.next;
            even = even.next;
        }
        odd.next = evenhead;
        return head;
    }
}
